<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    .root {
      height: 2500px;
      width: 1000px;
    }
    .top {
      height: 500px;
      width: 100px;
    }
    .child {
      width: 100px;
      height: 100px;
      position: sticky;
      top: 10px;
      background: red;
    }
  </style>
</head>
<body>
<div class="root">
  <div class="top"></div>
  <div class="child"></div>
</div>

<script>
  function findMax(arr) {
    return Math.max.apply(null, arr)
  }

  console.log(findMax([10, 2, 4, 15, 9]))

  const { max } = Math;

  console.log(max(...[10, 2, 4, 15, 9]))
  console.log(max.apply(null, [10, 2, 4, 15, 9]))

</script>
</body>
</html>
